#ifndef BTL_EXTRA_GUI_COLOURMAP
#define BTL_EXTRA_GUI_COLOURMAP

#include <Eigen/Core>

namespace btl
{
namespace extra
{
namespace gui
{

/// Implements a piecewise linear gradient
/// (like colormap() in matlab)
class ColourMap {
   public:
      // pre-defined colour bars
      static const ColourMap HSV;
      static const ColourMap Jet;
      static const ColourMap Grey;
      static const ColourMap ConstantWhite;

      ColourMap();
      ColourMap(const float data[][5], int count);

      Eigen::Vector4f at(double x) const;
   private:
      Eigen::VectorXf _stageBoundaries;
      Eigen::Matrix4Xf _stages;
};

} //namespace gui
} //namespace extra
} //namespace btl

namespace btl
{
namespace extra
{

using gui::ColourMap;

} //namespace extra
} //namespace btl

#endif // BTL_EXTRA_GUI_COLOURMAP
